﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DiracTCC.Business;

namespace DiracTCC.WinForm
{
    public partial class HtmlViewer : Form
    {
        FrameInfo frameInfo;
        SubBlockArray blockArray;

        public HtmlViewer()
        {
            InitializeComponent();
        }

        public void SetHtml(FrameInfo frame, SubBlockArray array)
        {
            frameInfo = frame;
            blockArray = array;

            if (!webBrowser1.IsDisposed)
            {
                webBrowser1.DocumentText =
                    GraphHelper.GetSubBlockGrid(frameInfo, blockArray, webBrowser1.Width, webBrowser1.Height);
            }
        }

        private void webBrowser1_Resize(object sender, EventArgs e)
        {
            webBrowser1.DocumentText =
                GraphHelper.GetSubBlockGrid(frameInfo, blockArray, webBrowser1.Width, webBrowser1.Height);

        }
    }
}
